﻿@using Microsoft.AspNet.Identity
@using WriterStars.Models

@if (Request.IsAuthenticated)
{
    using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm", @class = "navbar-right" }))
    {
        @Html.AntiForgeryToken()

        <ul class="nav navbar-nav navbar-right">
            <li>
                @Html.ActionLink("Hello " + User.Identity.GetFirstName() + "!", "Index", "Writer", routeValues: null, htmlAttributes: new { title = "Manage" })
            </li>
            <li><a href="javascript:document.getElementById('logoutForm').submit()">Log off</a></li>
        </ul>
    }
}
else
{
    <ul class="nav navbar-nav navbar-right">
        @if (ViewBag.Title == "Log in")
        {
            <li>@Html.ActionLink("Join for free", "Register", "Account", routeValues: null, htmlAttributes: new { id = "registerLink" })</li>
        }
        else
        {
            <li>@Html.ActionLink("About", "About", "Home")</li>
            <li>@Html.ActionLink("Log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })</li>
        }
        @*<li>
                @if (!this.Request.IsAuthenticated)
                {

                    using (Html.BeginForm("ExternalLogin", "Account", new { ReturnUrl = "/Home/Index" }))
                    {
                        @Html.AntiForgeryToken()
                        <div id="socialLoginList">
                            <p style="height:53px; line-height:53px; margin:0;">
                                <button type="submit" class="btn-social-facebook fui-facebook" style="font-size:14px;border:1px solid white;" id="Facebook" name="provider" value="Facebook" title="Log in using your Facebook account">
                                    <span>Log in</span>
                                </button>
                            </p>
                        </div>
                    }
                }

            </li>*@
    </ul>
}
